%one can choose the following parameter values

A=*;

v_theta = 1; %this is normalization
v_3_def = *;    
v_2_def = *;  
v_1_def = *;
kappa_def = *;  

v_z_def= *;
mu_def = *;

phi_def =0; % the default value of \phi is 0

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% the parameters are from the following ranges, respectively.
% A \in [1.5, 2.5);
% v_3_def, v_2_def, and v_1_def \in [0.05, 0.15) 

% kappa_def\in [1.45, 1.55)

%v_z_def\in [0.05, 0.15)
%mu_def \in [0.15, 0.25)

%%%%%%%%%%%%%%%%%%%%%%%%%%%
v_3 = v_3_def;  
v_2=v_2_def;
v_1=v_1_def;

kappa=kappa_def; 
v_z = v_z_def; v_z3=v_z;
mu = mu_def;
phi=phi_def;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% on \psi

%%%%%%%%%%%%%%%%%%%%%%%%%%%

I=40; x_min = 0.0001;
x_max = 1.5;
X  = x_min:(x_max-x_min)/(I-1):x_max;

S = X; S2 = X; S3=X; L=X;
i=1;
while i<I+0.5	
	psi = X(i); 	

    [rev, i1, i2, i3, rev_annual, mom, mom_skipping, cov12_23, cov12_34,  mom_annual] =buildup_func(A, v_theta, v_3, v_2, v_1, kappa, v_z, psi);
	S(i)	= rev; S2(i)=(i1+i2)/2; S3(i) =i3;
    
    [rev, i1, i2, i3, rev_annual, mom, mom_skipping, cov12_23, cov12_34,  mom_annual] =buildup_func(A, v_theta, v_3, v_2, v_1, kappa, v_z, psi);
    L(i) = mom;
   
	i=i+1;	
end

figure(1); 
plot(X, L, '-');
xlabel('$\psi$','Interpreter','Latex');
title('$ {\mathcal{L}}$','Interpreter','Latex');
%leg1=legend(['$\mathcal{L}$'] );
%set(leg1,'Interpreter','latex',  'Location', 'best');
saveas(gcf,'ia_fig12_L_on_psi','epsc');

figure(2); 
plot(X, S, '-', X, S2, '+', X, S3, 'x');
xlabel('$\psi$','Interpreter','Latex');
leg1=legend(['$\mathcal{S}$' ], ['$\mathcal{S}_{(2)}$' ], ['$\mathcal{S}_{(3)}$' ] );
set(leg1,'Interpreter','latex',  'Location', 'southwest');
saveas(gcf,'ia_fig13_S_on_psi','epsc');




